﻿<UserControl x:Class="ViCode_LeVi.Controls.VMTaskItemGroup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
    xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data">
    <vmcontrol:VMRootControl>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid Grid.Column="0" Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <ListView Name="ListView_TaskItems" Grid.Column="1" Grid.Row="0" 
                              SelectedItem="{Binding IM_Current_Task}"
                                ItemsSource="{Binding Tasks_Source}"
                              SelectionMode="Single">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn  DisplayMemberBinding="{Binding ID}">
                                <GridViewColumn.Header>
                                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_ID_Text"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn DisplayMemberBinding="{Binding Name}">
                                <GridViewColumn.Header>
                                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Name_Text"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn >
                                <GridViewColumn.Header>
                                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_IsActive_Text"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding Active}"      VerticalAlignment="Center"  />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn x:Name="GridViewColumn_Define">
                                <GridViewColumn.Header>
                                    <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Define_Text"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <vmcontrol:VMTextBlockNoWrap TextWrapping="NoWrap" TextTrimming="WordEllipsis" Text="{Binding Define}"      VerticalAlignment="Center"  />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>

                        </GridView>
                    </ListView.View>
                </ListView>

                <StackPanel Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" Orientation="Horizontal">
                    <Button Name="Button_AddNew" Content="Add" Margin="2"/>
                    <Button Name="Button_Remove" Content="Delete" Margin="2"/>
                </StackPanel>


                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_Name_Text" Margin="2"/>
                <vmcontrol:VMTextBox DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Name}" Margin="2"/>

                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_IsActive_Text" Margin="2"/>
                <CheckBox DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}" Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" IsChecked="{Binding Active}" Margin="2"/>

                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_Define_Text" Margin="2"/>
                <vmcontrol:VMTextBox_MultiLine DataContext="{Binding IM_Current_Task }" IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}"  Grid.Column="1" Grid.Row="4" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Define}" MinLines="6"  Margin="2"/>
            </Grid>


            <!--<GroupBox Header="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Control_Detail_Text}" Grid.Column="0" Grid.Row="2"  DataContext="{Binding IM_Current_Task }" >
            <Grid 
              IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}"
              >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" Name="ColumnDefinition1"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <vmcontrol:VMTextBlock Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Name_Text}" Margin="2"/>
                <vmcontrol:VMTextBox  Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Name}" Margin="2"/>

                <vmcontrol:VMTextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_IsActive_Text}" Margin="2"/>
                <CheckBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" IsChecked="{Binding Active}" Margin="2"/>

                <vmcontrol:VMTextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{Binding Source={x:Static Langs:ControlTextInfo.Intance}, Path=TaskItem_Define_Text}" Margin="2"/>
                <vmcontrol:VMTextBox_MultiLine  Grid.Column="1" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding Define}" MinLines="6"  Margin="2"/>

            </Grid>
        </GroupBox>-->
        </Grid>

    </vmcontrol:VMRootControl>
</UserControl>
